<%- if params[:authenticity_token].blank? -%>
<h1>Listing items</h1>

<div class="search_box">
  <%- form_tag(items_url, :method => 'get') do %>
  <%= text_field_tag :q, h(params[:q]) %>
  <%= submit_tag "Search", :name => nil %>
  <%- end -%>
</div>
<%- end -%>
<%= content_tag :div, "#{@items.size} items found" %>

<table>
  <tr>
<!--
    <th>Url</th>
    <th>User description</th>
    <th>Rms type</th>
-->
    <th><%= _('Name') %></th>
    <th><%= _('Description') %></th>
    <th><%= _('Price') + ' / 円' %></th>
    <th><%= _('Amount') %></th>
    <!--th>Created at</th>
    <th>Updated at</th-->
  </tr>

<% @items.each_with_index do |item, i| %>
  <tr class="record <%= 'even-record' if i % 2 == 0 %>">
<!--
    <td><%#= link_to_function '○', "$('item_show_#{item.id}').toggle()" %>
<%#= link_to 'Rakuten Link', item.url, :id => "item_show_#{item.id}", :style => "display: none;", :target => '_blank' %></td>
    <td><%=h item.user_description %></td>
    <td><%=h item.rms_type %></td>
-->
    <td><%= image_tag "ext/rakuten_ichiba_logo.gif", :height => 16 %> <%= link_to h(item.name), item.url.to_s, :target => '_blank' %></td>
    <td><%= image_tag item.description, :height => 30 if item.description%></td>
    <td class="price"><%= format_price(item.price) %></td>
    <td class="amount"><%=h item.amount %></td>
    <!--td><%=h item.created_at %></td>
    <td><%=h item.updated_at %></td-->
    <td><%= link_to 'Show', item %></td>
    <td><%= link_to 'Edit', edit_item_path(item) %></td>
    <td><%= link_to 'Destroy', item, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
  <tr>
    <td><%=h item.user_description %></td>
    <td><%=h item.rms_type %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New item', new_item_path %>
